package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.model.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserInfoMapper extends BaseMapper<UserInfo> {
    //查所有数据
    //修改返回值，ipage-替换list
    //在方发前第一个参数，配置分页page参数
    //由于方法参数是多个，参数前加@Param注解
    //在引导类配置分页插件
    @Select("SELECT * FROM `tb_user_info` where id in (SELECT black_user_id From tb_black_list WHERE user_id=#{userId})")
    IPage<UserInfo> findBlackList(@Param("page") Page<UserInfo> page, @Param("userId") Long userId);
}
